package com.custom.executor;

import com.custom.pojo.Configuration;
import com.custom.pojo.MappedStatement;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;

public interface Executor {
    /**
     * 查询操作
     * @param configuration
     * @param mappedStatement
     * @param params
     * @param <E>
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     * @throws NoSuchFieldException
     * @throws IllegalAccessException
     * @throws InvocationTargetException
     * @throws IntrospectionException
     * @throws InstantiationException
     */
     <E> List<E> query(Configuration configuration, MappedStatement mappedStatement,Object ... params) throws SQLException, ClassNotFoundException, NoSuchFieldException, IllegalAccessException, InvocationTargetException, IntrospectionException, InstantiationException;

    /**
     * 添加更新删除操作
     * @param configuration
     * @param mappedStatement
     * @param params
     * @return
     * @throws SQLException
     * @throws ClassNotFoundException
     * @throws NoSuchFieldException
     * @throws IllegalAccessException
     * @throws InvocationTargetException
     * @throws IntrospectionException
     * @throws InstantiationException
     */
     int update(Configuration configuration, MappedStatement mappedStatement,Object ... params) throws SQLException, ClassNotFoundException, NoSuchFieldException, IllegalAccessException, InvocationTargetException, IntrospectionException, InstantiationException;
}
